<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>天</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/base.css">
    <link rel="stylesheet" href="assets/css/style.css">
    <style>
        .gantt-layout-view .gantt-layout-grid .gantt-layout-content {
            white-space: normal !important;
        }
    </style>
</head>
<body>
<div id="gantt_day">
    <div class="gantt-layout" style="height: 300px;">
        <div class="gantt-layout-view">
            <div class="gantt-layout-grid gantt-layout-grid-right">
                <div class="gantt-layout-content">
                    <div class="gantt-layout-header">
                        <div class="gantt-layout-row"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/jq.gantt-1.0.1.js"></script>
<script type="text/javascript">
    var start = new Date('2020-6-1'),
        end = new Date('2020-12-31');

    var between = function (start, end) {
        var date1 = new Date(start.getFullYear(), start.getMonth(), start.getDate()),
            date2 = new Date(end.getFullYear(), end.getMonth(), end.getDate());
        return (date2.getTime() - date1.getTime()) / (1 * 24 * 60 * 60 * 1000);
    };

    var next = function (dayNumber, start) {
        dayNumber = dayNumber || 1;
        var now = start || new Date(), arr = [now];
        for (var i = 1; i < dayNumber; i++) {
            var day = new Date(now);
            day.setDate(day.getDate() + i);
            arr.push(day);
        }
        return arr;
    };

    var range = function (start, end) {
        return next(between(start, end) + 1, start);
    };

    var values = range(start, end), $row = $('.gantt-layout-row');

    $.each(values, function(i, date){
        var fm = Gantt.date(date, 'yyyy/MM/dd'), value = Gantt.date(date, 'MM/dd');
        var obj = {};
        obj.date = date;
        obj.weekNo = Gantt.weekNo(date);
        obj.month = date.getMonth() + 1;
        obj.quarter = Gantt.dateQuarter(date);
        obj.year = date.getFullYear();
        console.log(fm, obj);
        $row.append('<div class="gantt-grid-cell"><span>'+ value +'</span></div>');
    });
</script>
</body>
</html>